package org.springdata.chap1.dao;

import javax.persistence.Query;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class HibernateDao {
	
//@Autowired
private SessionFactory Sessionfact; 

public SessionFactory getSessionfact() { 	System.out.println("aa");		return Sessionfact;	} 
public void setSessionfact(SessionFactory sessionfact) {	System.out.println("bb");		Sessionfact = sessionfact;	}



public int getCirclecount(){
	System.out.println("aaaaaa");
String hql="select Count(*) from circle";
	org.hibernate.Query q1=  getSessionfact().openSession().createQuery(hql);
	
	return (int) q1.uniqueResult();
	
}
}
